<% include header %>
<div id="mainid">
<% include nav %>

<div class="text-center infoMessage">
    <!--提示信息的区域-->
    <% if(success){ %>
    <%= success %>
    <% }else{ %>
    <%= error %>
    <% } %>
</div>
<!--日历插件-->
<% include calendar %>
<% include clock %>
<% include menulist %>
<!--显示标题和文章内容-->
<div class="panel-group">
    <!--不写action属性，默认提交到当前路径-->
    <form method="post">
        <!--禁止标题修改-->
        <label for="editTitle">标题：</label>
        <input type="text" class="form-control" disabled="disabled" value="<%= doc.title %>">
        <label for="editContent" class="contentLabel">内容：</label>
        <textarea name="content" class="form-control exampleText" rows="10"><%- doc.content %></textarea>
        <button type="submit" class="btn btn-primary btn-sm">提交</button>
        <button class="btn btn-default btn-sm callback">返回</button>
    </form>
</div>
</div>
<% include footer %>
<!--点击返回按钮回到上一个url页面-->
<script>
    $(function () {
        $('.callback').click(function (e) {
            //禁止提交表单
            e.preventDefault();
            location.href='/main';
        });
        //
        setTimeout(function () {
            $('.infoMessage').fadeOut();
        },2000)
    })
</script>